<!-- quote template -->
<?php require '../public/system/headers/headers.php';?>
<html>
	<head>
		<title>{%Quote%} [<?php echo $this->quoteName; ?>]</title>
		<?php echo $this->headLink()->appendStylesheet($this->websiteUrl . '/system/css/seotoaster.css'); ?>
	</head>
	<body>
		<div id="quotemain">
			<div id="quotemainwrap">
				<div id="tophead">
					<div id="companyinfo">
                        <?php if (is_file($this->sitePath.'public/'.$this->shoppingConfigData['company_logo'])) : ?>
                        <img src="<?php echo $this->websiteUrl.$this->shoppingConfigData['company_logo']; ?>" alt="company logo" style="max-width:130px;max-height:130px;"/>
                        <?php endif; ?>
                        <br />
                        <p><?php echo $this->shoppingConfigData['company']; ?></p>
                        <p><?php
                            echo $this->shoppingConfigData['address'];
                            if (!empty($this->shoppingConfigData['address']) && !empty($this->shoppingConfigData['address2'])) echo ', ';
                            if (!empty($this->shoppingConfigData['address2'])) echo $this->shoppingConfigData['address2'];
                        ?></p>
                        <p><?php
                            if (!empty($this->shoppingConfigData['city'])) echo $this->shoppingConfigData['city'];
                            if (!empty($this->shoppingConfigData['city']) && (!empty($this->shoppingConfigData['state']) or !empty($this->shoppingConfigData['zip']))) echo ', ';
                            if (!empty($this->shoppingConfigData['state'])) echo $this->shoppingConfigData['state'];
                            if (!empty($this->shoppingConfigData['state']) && !empty($this->shoppingConfigData['zip'])) echo ' ';
                            if (!empty($this->shoppingConfigData['zip'])) echo $this->shoppingConfigData['zip'];
                            ?></p>
                        <p><?php if (!empty($this->shoppingConfigData['country'])) echo $this->shoppingConfigData['country'];?></p>
                        <p><?php echo $this->shoppingConfigData['phone'];?></p>
                        <p><a href="mailto:<?php echo $this->shoppingConfigData['email']; ?>"><?php echo $this->shoppingConfigData['email']; ?></a></p>
                        <br />
                                               
			</div>
                    <?php if (isset($this->shippingAddress)) : ?>
                    <!--div id="shippinginfo">
                                                <p style="text-align: right; margin-right: 15px;">{%Shipped to%}:</p>
                                                <p><?php echo $this->shippingAddress['firstname'] . ' ' . $this->shippingAddress['lastname']; ?></p>
                                                <p>
                                                <?php if (trim($this->shippingAddress['address1'])!='') echo $this->shippingAddress['address1'];
                                                 if (trim($this->shippingAddress['address1'])!='' && trim($this->shippingAddress['address2'])!='') echo ', ';
                                                 if (trim($this->shippingAddress['address2'])!='') echo $this->shippingAddress['address2'] ; ?></p>
                                                <p>
                                                <?php if (trim($this->shippingAddress['city'])!='') echo $this->shippingAddress['city'];
                                                 if (trim($this->shippingAddress['city'])!='' && (trim($this->shippingAddress['state'])!='' or trim($this->shippingAddress['zip'])!='')) echo ', ';
                                                 if (trim($this->shippingAddress['state'])!='') echo $this->shippingAddress['state'];
                                                 if (trim($this->shippingAddress['state'])!='' && trim($this->shippingAddress['zip'])!='') echo ' ';
                                                 if (trim($this->shippingAddress['zip'])!='') echo $this->shippingAddress['zip'];
                                                 ?>
                                                </p>
                                                <p>
                                                <?php if (trim($this->shippingAddress['country'])!='') echo $this->shippingAddress['country']; ?>
                                                </p>
                                                <p><?php if (trim($this->shippingAddress['phone'])!='') echo $this->shippingAddress['phone']; ?></p>
                                                <p><a href="mailto:<?php echo $this->shippingAddress['email']; ?>"><?php echo $this->shippingAddress['email']; ?></a></p>
                    </div-->
                    <?php endif; ?>
					<div id="clientinfo">
                                                <p style="text-align: right; margin-right: 15px;"><?php echo $this->quoteDate; ?></p>
                                                <p><?php echo $this->userName; ?></p>
                                                <p><?php if (trim($this->userCompany)!='') echo $this->userCompany; ?></p>
                                                <p>
                                                <?php if (trim($this->userAddress1)!='') echo $this->userAddress1; 
                                                 if (trim($this->userAddress1)!='' && trim($this->userAddress2)!='') echo ', ';
                                                 if (trim($this->userAddress2)!='') echo $this->userAddress2 ; ?></p>
                                                <p>
                                                <?php if (trim($this->userCity)!='') echo $this->userCity; 
                                                 if (trim($this->userCity)!='' && (trim($this->userState)!='' or trim($this->userZip)!='')) echo ', ';
                                                 if (trim($this->userState)!='') echo $this->userState; 
                                                 if (trim($this->userState)!='' && trim($this->userZip)!='') echo ' ';
                                                 if (trim($this->userZip)!='') echo $this->userZip;
                                                 ?>
                                                </p>
                                                <p>
                                                <?php if (trim($this->userCountry)!='') echo $this->userCountry; ?>
                                                </p>
                                                <p><?php if (trim($this->userPhone)!='') echo $this->userPhone; ?></p>
                                                <p><a href="mailto:<?php echo $this->userEmail; ?>"><?php echo $this->userEmail; ?></a></p>
                                                         
                        <div style="float:right;margin:20px 15px 0px 0px;"><a href="<?php echo $this->websiteUrl; ?>sys/backend_quote/pdf/id/<?php echo $this->quoteId; ?>/" target="_blank" style="color:#5C5C5C;">Print PDF</a></div>
					</div>
				</div>
                <div id="quotebody" style="clear:both;">
					<div id="quotetitle">
						<h1>{%Quote%} # <?php echo $this->quoteId; ?></h1>
					</div>
					<div id="usercart-legend">
						<div class="photo">{%Photo%}</div>
						<div class="name">{%Product%}</div>
						<div class="note">{%Note%}</div>
						<div class="qty">{%Qty%}</div>
						<div class="price">{%Price%}(<span style="font-size: 12px;"><?php echo $this->shoppingConfigData['currency']; ?></span>)</div>
					</div>
					<div id="quoteusercart">
						<?php if(!empty($this->cartData)): ?>
							<?php foreach ($this->cartData as $id => $cartItem): ?>
								<div class="usercart-item-product">
                                                                        <div class="photo"><img src="<?php echo $this->websiteUrl . $cartItem['photo']; ?>" width="50" height="50" alt="<?php echo $cartItem['name']; ?>"/></div>
									<div class="name"><?php echo $cartItem['name']; ?></div>
									<div class="note"><?php echo $cartItem['note']; ?></div>
									<div class="qty"><?php echo $cartItem['count']; ?></div>
									<div class="price"><?php echo $cartItem['price']; ?>&nbsp;<span style="font-size: 12px;"><?php echo $this->shoppingConfigData['currency']; ?></span></div>
								</div>
							<?php endforeach; ?>
						<?php endif; ?>
					</div>
					<div id="total">
                    <div class="lbl">{%Sub-total%}:</div> <div class="cnt"><?php echo $this->totalPrice; ?> <span style="font-size: 12px;"><?php echo $this->shoppingConfigData['currency']; ?></span></div>
                    <div class="lbl">{%Tax%}:</div> <div class="cnt"><?php echo $this->totalTax; ?> <span style="font-size: 12px;"><?php echo $this->shoppingConfigData['currency']; ?></span></div>
                    <?php if (!empty($this->shipping) && $this->shipping != '0') : ?>
                    <div class="lbl">{%Shipping%}:</div> <div class="cnt"><span style="font-size: 20px;"><?php echo $this->shipping; ?></span> <span style="font-size: 12px;"><?php echo $this->shoppingConfigData['currency']; ?></span></div>
                    <?php endif; ?>
                    <hr size="2"/>
                    <div class="lbl">{%Grand Total%}:</div> <div class="cnt" id="grand-total"><?php echo ($this->totalPrice+$this->totalTax+$this->shipping); ?> <span style="font-size: 12px;"><?php echo $this->shoppingConfigData['currency']; ?></span></div>
					</div>
				</div>
				<div id="quotefooter">
					<?php echo ($this->quoteDisclaimer == 'Disclaimer: ') ? '' : $this->quoteDisclaimer; ?>
				</div>
			</div>
		</div>
	</body>
</html>